package org.social.controller;

import org.error.GameErrorCode;
import org.social.db.bean.PlayerMap;
import org.social.db.cache.PlayerMapCache;
import org.utils.RemoteUtil;

import com.dal.gm_api.api.IPlayerData;
import com.dal.gm_api.util.GMError;

/**
 * Created by fxf on 2018-1-16.
 */
public class PlayerDataServer implements IPlayerData {
    @Override
    public Object getGameData(String className, String methodName, Object id) {
        PlayerMap playerMap = PlayerMapCache.me().getByPid((Integer)id);
        GMError.isAndTrue(GameErrorCode.NOR_FONT_PLAYERINFO, playerMap == null);
        return RemoteUtil.gameSync(playerMap.getServerId()).getGameData(className, methodName, id);
    }
}
